From: Carlos Garnacho Date: Thu, 31 Jul 2014 15:26:47 +0000 (+0200) Subject: panel: Avoid _onEvent() to be called twice X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2290 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a6d8c25494a3a9aabbbd0b21a77b2c4baebfa736;p=gnome-shell.git panel: Avoid _onEvent() to be called twice Both Panel.ActivitiesButton and its parent class Panel.MenuButton would attempt to connect their own _onEvent() function to Clutter::event, which counterintuitively was connecting the child class' _onEvent() function twice. So, actually chain up on the signal handler, and don't connect twice to the signal. Both methods were calling this.menu.close(), so only do that on the parent class handler, since we're chaining up and doing the right thing now. https://bugzilla.gnome.org/show_bug.cgi?id=733840 --- diff --git a/js/ui/panel.js b/js/ui/panel.js index 10fe169c4..3c2ab6bef 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -571,7 +571,6 @@ const ActivitiesButton = new Lang.Class({ this.actor.label_actor = this._label; this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent)); - this.actor.connect_after('event', Lang.bind(this, this._onEvent)); this.actor.connect_after('key-release-event', Lang.bind(this, this._onKeyRelease)); Main.overview.connect('showing', Lang.bind(this, function() { @@ -609,12 +608,12 @@ const ActivitiesButton = new Lang.Class({ }, _onEvent: function(actor, event) { - if (event.type() == Clutter.EventType.TOUCH_END || - event.type() == Clutter.EventType.BUTTON_RELEASE) { + this.parent(actor, event); + if (event.type() == Clutter.EventType.TOUCH_END || + event.type() == Clutter.EventType.BUTTON_RELEASE) Main.overview.toggle(); - this.menu.close(); - } + return Clutter.EVENT_PROPAGATE; },